package com.huawei.appmarket.service.settings.card;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.huawei.appgallery.foundation.store.bean.detail.DetailResponse;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse.LayoutData;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appgallery.serverreqkit.api.listener.IServerCallBack;
import com.huawei.appgallery.share.api.ShareBean;
import com.huawei.appmarket.service.appdetail.bean.detail.DetailHiddenBean;
import java.util.List;
import o.azb;
import o.ccz;
import o.cfv;
import o.cfw;
import o.cgz;
import o.cvt;
import o.BaseRequest;
import o.cww;
import o.der.d;
import o.der.e;
import o.der.f;
import o.dgm;
import o.djl;
import o.dky.j;
import o.Logger;
import o.doo;
import o.ContentManager;
import o.drj;
import o.evk;
import o.evx;
import o.fho;

public class AboutShareAppCard extends BaseAboutCard {
    private djl ʻ;
    private evx ʽ = new evx(this) {
        final /* synthetic */ AboutShareAppCard ˋ;

        {
            this.ˋ = r1;
        }

        public void ˋ(View view) {
            this.ˋ.ˊ();
        }
    };
    private boolean ˊ = false;
    protected View ˋ;
    protected View ˎ;
    protected TextView ˏ;
    private final IServerCallBack ॱॱ = new IServerCallBack(this) {
        final /* synthetic */ AboutShareAppCard ˎ;

        {
            this.ˎ = r1;
        }

        public void prePostResult(BaseRequest o_cvu, ResponseBean responseBean) {
        }

        public void notifyResult(BaseRequest o_cvu, ResponseBean responseBean) {
            this.ˎ.ˋ();
            if (responseBean == null || responseBean.getResponseCode() != 0) {
                evk.ˋ(this.ˎ.ᐝ, this.ˎ.ᐝ.getResources().getString(f.ʻʽ), 0).ˋ();
            } else if (!this.ˎ.ˊ) {
                List<LayoutData> ᐝॱ = ((DetailResponse) responseBean).ᐝॱ();
                if (!(ᐝॱ == null || ᐝॱ.isEmpty())) {
                    for (LayoutData layoutData : ᐝॱ) {
                        if (layoutData.ˋ() != null && !layoutData.ˋ().isEmpty() && (layoutData.ˋ().get(0) instanceof DetailHiddenBean)) {
                            DetailHiddenBean detailHiddenBean = (DetailHiddenBean) layoutData.ˋ().get(0);
                            String ॱˌ = detailHiddenBean.ॱˌ();
                            String ᶥ = detailHiddenBean.ᶥ();
                            String ॱـ = detailHiddenBean.ॱـ();
                            String string = this.ˎ.ᐝ.getResources().getString(j.ʼ);
                            String str = string + '，' + this.ˎ.ᐝ.getResources().getString(f.ͺͺ);
                            ShareBean shareBean = new ShareBean();
                            shareBean.ॱ(str);
                            shareBean.ˎ(string);
                            shareBean.ˋ(ॱˌ);
                            shareBean.ˊ(e.ˊˊ);
                            shareBean.ˊ(ᶥ);
                            shareBean.ˏ("about");
                            shareBean.ʽ(null);
                            shareBean.ॱॱ(null);
                            shareBean.ʼ(ॱـ);
                            ((cww) fho.ˏ().ˋ("Share").ॱ(cww.class)).ˎ(this.ˎ.ᐝ, shareBean);
                            return;
                        }
                    }
                }
                evk.ˋ(this.ˎ.ᐝ, this.ˎ.ᐝ.getResources().getString(f.ˏˍ), 0).ˋ();
            }
        }
    };

    public AboutShareAppCard(Context context) {
        super(context);
    }

    public cgz ˏ(View view) {
        super.ˏ(view);
        this.ˋ = view.findViewById(d.ʹ);
        azb.ˏ(this.ˋ);
        this.ˏ = (TextView) view.findViewById(d.ꜞॱ);
        this.ˎ = (ImageView) view.findViewById(d.ˊʼ);
        azb.ॱॱ(this.ˎ);
        this.ˏ.setText(this.ᐝ.getString(f.ॱॱ));
        this.ˋ.setOnClickListener(this.ʽ);
        return this;
    }

    private void ˊ() {
        if (doo.ˊ(this.ᐝ)) {
            this.ˊ = false;
            String ॱ = drj.ॱ(this.ᐝ.getPackageName());
            int ॱ2 = ccz.ॱ();
            if (this.ᐝ instanceof Activity) {
                ॱ2 = dgm.ˎ((Activity) this.ᐝ);
            }
            cvt ˎ = cfv.ˎ(ॱ, "", ॱ2, 1);
            if (this.ʻ == null) {
                this.ʻ = new djl(this.ᐝ);
                this.ʻ.ˋ(ContentManager.getInstant().getContext().getString(f.ˏꜟ));
            }
            this.ʻ.show();
            cfw.ˎ(ˎ, this.ॱॱ);
            return;
        }
        evk.ˏ(this.ᐝ, f.ʻʽ, 0).ˋ();
    }

    private void ˋ() {
        try {
            if (this.ʻ != null && this.ʻ.isShowing()) {
                this.ʻ.dismiss();
                this.ʻ = null;
            }
        } catch (Throwable e) {
            Logger.ˋ("AboutActivity", "stopLoading error", e);
        }
    }

    public void ˏ(CardBean cardBean) {
        super.ˏ(cardBean);
    }
}
